home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 8.8 KB | 212 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: ClarisCad.vu
- #
- # Contains: Quick look test script for Claris Cad version 2.0v3
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.6> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.5> 9/28/93 KTA Added returnVal for ModifyDocument hook.
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)()to InitGlobals(ScriptLevel)()
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib", "Da.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: KA
- # Description: Sets up tools and fonts for Claris Cad. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick, kDragClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kToolPaletteNum := 1;
- global kColorPaletteNum := 0;
- global kPatternPaletteNum := 2;
- global kGradientPaletteNum := 0;
-
- global gWindowInset := {67,35,20,35}; # Window inset
- global gScreenInset := {0,20,0,0}; # Screen inset
- global gVoidRect := {}; # Rect not to draw in - coordinates should be RelativeToWindow
- global gLineWeights := {'0.1 mm','0.35 mm','0.7 mm','0.016 inch','0.032 inch','0.064 inch'};
- global gTextStr;
-
- global gPaletteList := {
- { #### Start Palette #1 - Tools
- {0, 20, 50, 223,0}, # Location of palette relative to the window
- kPalDocWind, # Palette type
- {2,12}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {24,17} # Offset between tools {h,v}
- }, #### End Palette #1
- {
- {96, 20, 465, 35,0}, # Location of palette relative to the window
- kPalDocWind, # Palette type
- {23,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {17,0} # Offset between tools {h,v}
- } #### End Palette #2
- };
-
- ### Claris CAD {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global SelectTool := { 1, 1, "Select", kClick, 0, {0} };
- global unknown := { 2, 1, "Plus", 0, 0, {0} };
- global CharTool := { 3, 1, "Char", kDrag, 0, {gTextStr,0,0,0}};
- global unknown := { 4, 1, "Line", kDrag, 0, {0} };
- global LineTool := { 5, 1, "Line", kDrag, 0, {1,0,1,0} };
- global unknown := { 6, 1, "Line", kDrag, 0, {0} };
- global RectTool := { 7, 1, "Rectangle",kDrag, 0, {1,1,1,0} };
- global unknown := { 8, 1, "Rectangle",kDrag, 0, {1,1,1,0} };
- global RndRectTool := { 9, 1, "RndRect", kDrag, 0, {1,1,1,0} };
- global unknown := { 10, 1, "RndRect", kDrag, 0, {1,1,1,0} };
- global OvalTool := { 11, 1, "Oval", kDrag, 0, {1,1,1,0} };
- global unknown := { 12, 1, "Oval", kDrag, 0, {1,1,1,0} };
- global ArcTool := { 13, 1, "Arc", kDragClick, 0, {2,1,1,0} };
- global unknown := { 14, 1, "Arc", kDrag, 0, {2,1,1,0} };
- global FreeTool := { 15, 1, "Freehand", kMultiDrag, 0, {2,1,1,0} };
- global unknown := { 16, 1, "Freehand", kMultiDrag, 0, {2,1,1,0} };
- global MultiLineTool := { 17, 1, "MultiLineTool", kMultiClick,1, {2,1,1,0} };
- global unknown := { 18, 1, "Polygon", kMultiClick,0, {2,1,1,0} };
- global LengthTool := { 19, 1, "LengthTool",kDragClick, 0, {2,1,1,0} };
- global unknown := { 20, 1, "", 0, 0, {0} };
- global unknown := { 21, 1, "", 0, 0, {0} };
- global unknown := { 22, 1, "", 0, 0, {0} };
- global unknown := { 23, 1, "", 0, 0, {0} };
- global unknown := { 24, 1, "", 0, 0, {0} };
- global PenLine := { '', {87,29,1}, "PenLine", 0, 0, {0} };
- global ZoomOut := { '', {5,-6,2}, "ZoomOut", 0, 0, {0} };
- global ZoomIn := { '', {17,-6,2}, "ZoomIn", 0, 0, {0} };
-
- # global Tool list
- global gToolList:={ SelectTool,
- CharTool,
- LineTool,
- RectTool,
- RndRectTool,
- OvalTool,
- ArcTool,
- FreeTool,
- MultiLineTool
-
- };
-
- ### font characteristic lists
- global gFontSizeList := {'9','10','12','14','18', '24','36','48'};
- global gFontStyleList := {'Bold','Italic','Outline', 'Underline','Shadow','Left','Right','Center','Justified','lowercase','UPPERCASE'};
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := "Plain Text"; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 1;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- end; #InitAppGlobals
-
- #########################################################################
- # ClarisCadSetupDoText()
- #========================================================================
- # Author: ML
- # Description: Setup document for DoText()
- # Parameters: None
- # Returns: Nothing
- # Examples: ClarisCadSetupDoText();
- # Assumptions: None
- # Applications: Claris Cad
- #========================================================================
- # History:
- #
- #########################################################################
- task ClarisCadSetupDoText()
- begin
- logstr("Setting up for DoText()");
- Draw(global CharTool);
- end;
-
- #########################################################################
- # ClarisCadModifyDocument()
- #========================================================================
- # Author: ML
- # Description: Modify Claris Cad Document
- # Parameters: None
- # Returns: Nothing
- # Examples: ClarisCadModifyDocument();
- # Assumptions: None
- # Applications: Claris Cad
- #========================================================================
- # History:
- #
- #########################################################################
- task ClarisCadModifyDocument()
- begin
- return(Scrapbook(global kScrapTEXT));
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script ClarisCad (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel); # initialize your general globals
- InitDraw();
- InitFonts();
- global gApptitle := "Claris Cad";
- global gAppVersion := '2'; # version of app you will be running
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; # This is used in SaveAs when saving files
- SuiteStart('ClarisCad.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- global gSetLine := Task SetLineMenuItems; # Requires VU 2.0
- global gSetupDoText:= task ClarisCadSetupDoText; # define app specific task
- global gModifyDocument:= task ClarisCadModifyDocument; # define app specific task
- InitAppGlobals(); # init app specific globals
- (*
- *)
- DoSetUpApp(,,,,1,1);
- DoDraw();
- DoText();
- DoWindow();
- DoCloseApp(1);
- LogStr("############################# LIMITATIONS: ############################");
- LogStr("NOTE: Patterns may not be selected if Claris Cad not configured to show this palette");
- LogStr("NOTE: Objects may not be drawn if the start point is not in the defined drawing space");
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script ClarisCad